package com.credit.management.system.generator.dao;

import com.credit.management.system.model.Syuser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SyuserMapper {
    @Delete({
        "delete from syuser",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into syuser (id, name, ",
        "password, createtime, ",
        "realname, phone, ",
        "camera, birthday, ",
        "state, address, ",
        "email)",
        "values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{password,jdbcType=VARCHAR}, #{createtime,jdbcType=VARCHAR}, ",
        "#{realname,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, ",
        "#{camera,jdbcType=VARCHAR}, #{birthday,jdbcType=VARCHAR}, ",
        "#{state,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, ",
        "#{email,jdbcType=VARCHAR})"
    })
    int insert(Syuser record);

    int insertSelective(Syuser record);

    @Select({
        "select",
        "id, name, password, createtime, realname, phone, camera, birthday, state, address, ",
        "email",
        "from syuser",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.credit.management.system.generator.dao.SyuserMapper.BaseResultMap")
    Syuser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Syuser record);

    @Update({
        "update syuser",
        "set name = #{name,jdbcType=VARCHAR},",
          "password = #{password,jdbcType=VARCHAR},",
          "createtime = #{createtime,jdbcType=VARCHAR},",
          "realname = #{realname,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "camera = #{camera,jdbcType=VARCHAR},",
          "birthday = #{birthday,jdbcType=VARCHAR},",
          "state = #{state,jdbcType=VARCHAR},",
          "address = #{address,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Syuser record);
}